﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="description" content="{$cfg_site_description}" />

<title>{$cfg_site_name}</title>
{template 'header'}
<body>
<div id="sysmsg-error-box" style="top:157px;display: none;">
		<div class="sysmsgw hidd" id="sysmsg-error" style="display: block;">
			<div class="sysmsg"><span>{$ERROR_MSG}</span><span class="close">關閉</span></div>
		</div>
		<div class="sysmsgw hidd" id="sysmsg-success" style="display: none;">
			<div class="sysmsg"><span></span><span class="close">關閉</span></div>
		</div>
</div>

<div id="buy917_wrap">
	<div id="buy917_login">
     <div class="logins">
	 {if !empty($_USERS)}
      <ul id="account">
        <li title="tlover" class="username">歡迎您，{$_USERS['uname']}！</li>
        <li class="account1">&nbsp;
		<a href="m.php?action=bond&type=available">我的團購券</a> | <a href="m.php?action=orders&type=all">我的訂單</a> | 
		<a href="m.php?action=account">帳戶餘額</a> | <a href="m.php?action=settings">帳戶設置 | </a>
		</li>
        <li class="logout"><a href="quit.php">退出</a></li>
      </ul>
      {else}
      <ul id="account">
        <li class="login"><a href="login.php">會員登入 | 註冊</a></li>       
      </ul>
      {/if}
      </div>   
	</div>    
    <div id="buy917_header">
    	<div id="buy917_logo"><a href="index.php">Buy917</a></div>
        <div class="buy917_header_banner">
        	<div class="buy917_header_topbanner">
            <?php include("admin/event.php")?>
            </div>
          	<div class="buy917_header_select">
            	<div class="buy917_header_city">
                	 {if !empty($_cityid)}
                    <div class="guides">
                        <div class="city">
                            <h2>{$_cityname}</h2>
                        </div>
                        <div id="guides-city-change" class="change">切換城市</div>
                        <div id="guides-city-list" class="city-list">
                            <ul>
                            {loop $_citylist $v}
                                <li {if $v['cid']==$_cityid}class="current"{/if}><a href="index.php?cityid={$v['cid']}">{$v['cityname']}</a></li>
                            {/loop}
                            </ul>                   
                        </div>
                    </div>
                    {/if}	
                </div>
                <div class="buy917_header_group">
                	{template 'headergroup'}	
                </div>
            </div>
       </div>
    </div><!-- buy917_header -->
  
    <div id="buy917_menu">
    	<a href="index.php">馬上 揪一起</a>
        <a href="grouplist.php">曾經 揪一起</a>
        <a href="article.php?aid=3" <?php if($_GET['aid']== 3){ echo "class='on'";} ?>>怎樣 揪一起</a>
        <a href="article.php?aid=1" class="end <?php if($_GET['aid']== 1){ echo "on";} ?>">問答 揪一起</a>       
    </div><!-- buy917_menu -->
       
    <div id="buy917_middle">
        	<div class="buy917_grouplist_top"></div>      
            <div class="buy917_grouplist_body"> 
               <h2>會員登入<span>&nbsp;或者 <a href="reg.php">註冊新帳號</a></span></h2>
        		  <div class="sect">

                    <form id="signup-user-form" method="post" action="reg.php">
                        <div class="field username">

                            <label for="signup-username">帳號名稱</label>
                            <input type="text" size="30" name="username" id="signup-username" class="f-input" value="" />
                            <span class="hint"> 4 ~ 16 個字元，一個中文字為兩個字元</span>
                        </div>
                        <div class="field password">
                            <label for="signup-password">密碼</label>
                            <input type="password" size="30" name="password" id="signup-password" class="f-input" />

                            <span class="hint">最少 4 個字元</span>
                        </div>	
                        <div class="field password">
                            <label for="signup-password-confirm">確認密碼</label>
                            <input type="password" size="30" name="password2" id="signup-password-confirm" class="f-input" />
                        </div>										
                        <div class="field">
                            <label for="signup-email-address">Email</label>
                            <input type="text" size="30" name="email" id="signup-email-address" class="f-input" value="" />
                            <span class="f-input-tip"></span> 
                            <span class="hint">忘記密碼時使用，不會公開</span>
                        </div>

                        <div class="field city" style=" display:none;">
                            <label id="enter-address-city-label" for="signup-city">所在城市</label>

                            <select name="cityid" autocomplete="off" class="f-city">
                            <option value="1" selected="selected">北京</option><option value="10" >上海</option><option value="20" >廣州</option><option value="30" >深圳</option><option value="40" >天津</option><option value="42" >西安</option><option value="44" >福州</option><option value="45" >重慶</option><option value="50" >杭州</option><option value="55" >南京</option><option value="57" >武漢</option><option value="59" >成都</option><option value="60" >青島</option><option value="62" >廈門</option><option value="65" >大連</option><option value="0" >其他</option>                            </select>

                            <p class="enter-city" style="display:none "><input id="enter-address-city" autocomplete="off" name="cityname" class="f-text f-cityname" type="text" value="" /></p>
                        </div>
                        <div class="field subscribe">
                            <input tabindex="3" type="checkbox" value="1" name="subscribe" id="subscribe" class="f-check" checked="checked" />
                            <span for="subscribe">訂閱每日最新團購訊息</span>
                        </div>
						                        <div class="clear"></div>
                        <div class="act">

                            <input type="submit" value="註冊" name="commit" id="signup-submit" class="formbutton"/>
                        </div>
                    </form>
                </div>
                
                 <div class="sbox-top"></div>
                <div class="sbox-content">
                    <div class="side-tip">
                        <h2>帳號名稱{$cfg_site_name}已註冊!!</h2>
                        <p>請直接<a href="/login.php">登入</a>。</p>
                    </div>
    
                </div>
            </div><!-- buy917_grouplist_body -->
            <div class="buy917_grouplist_bottom"></div>
    </div><!-- buy917_middle -->
</div><!-- buy917wrap -->
<!-- footer -->
<script type="text/javascript"> 
jQuery(function($){
	
	$("#signup-submit").click(function(){
	
		if(!$.minLength($("#signup-username").val(),4,true))
		{
			$.showErr("帳號名稱太短，至少 4 個字元或 2 個中文字");
			$("#signup-username").focus();
			return false;
		}
		
		if(!$.maxLength($("#signup-username").val(),16,true))
		{
			$.showErr("帳號名稱太長，最多 16 個字元或 8 個中文字");
			$("#signup-username").focus();
			return false;
		}
		
		if(!$.minLength($("#signup-password").val(),4,false))
		{
			$.showErr("密碼太短，至少 4 個字元");
			$("#signup-password").focus();
			return false;
		}
		
		if($("#signup-password-confirm").val() != $("#signup-password").val())
		{
			$.showErr("密碼跟確認密碼不一樣，請重新輸入");
			$("#signup-password-confirm").focus();
			return false;
		}
		
		if($("#signup-password-confirm").val() != $("#signup-password").val())
		{
			$.showErr("密碼跟確認密碼不一樣，請重新輸入");
			$("#signup-password-confirm").focus();
			return false;
		}
		if($.trim($("#signup-email-address").val()).length == 0)
		{
			$.showErr("請輸入您的 E-mail 地址");
			$("#signup-email-address").focus();
			return false;
		}
		if(!$.checkEmail($("#signup-email-address").val()))
		{
			$.showErr("您輸入的 E-mail 地址不正確");
			$("#signup-email-address").focus();
			return false;
		}	
		
		
		
		
	});
});
</script>

<div id="buy917_footer">
	{template 'footer'}	
</div>
</body>
</html>
